home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / HARDWARE.SWG / 0012_Determine CPU Type.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  2KB  |  89 lines

  1. Unit CPU;
  2.  
  3. INTERFACE
  4.  
  5. Type
  6.   CpuType = ( cpu8088,
  7.               cpu8086,
  8.               cpu80286,
  9.               cpu80386,
  10.               cpu80486,
  11.               cpuPentium,
  12.               cpuFuture
  13.              );
  14.   CpuStrType = String[7];
  15.  
  16. Function GetCpuType : CpuType;
  17.   { Returns the currently executing CPU type }
  18.  
  19. Function GetCpuTypeStr : CpuStrType;
  20.   { Returns the currently executing CPU type as a string }
  21.  
  22. IMPLEMENTATION
  23.  
  24. Const
  25.   CpuTypeIdentified : Boolean = False;
  26. Var
  27.   ConfirmedCpuType : CpuType;
  28.  
  29. {$L CPU.OBJ}
  30.  
  31. {$F+}
  32. Function WhichCPU : CpuType;
  33.   { Determines and returns the currently executing CPU type }
  34. EXTERNAL;
  35. {$F-}
  36.  
  37. Procedure IdentifyCpuType;
  38.   { Handles initialization of CPU type }
  39. Begin
  40.   If Not CpuTypeIdentified Then
  41.   Begin
  42.     ConfirmedCpuType  := WhichCPU;
  43.     CpuTypeIdentified := True;
  44.   End;
  45. End;   { Procedure IdentifyCpuType }
  46.  
  47. Function GetCpuType : CpuType;
  48.   { Returns the currently executing CPU type }
  49. Begin
  50.   IdentifyCpuType;
  51.   GetCpuType := ConfirmedCpuType;
  52. End;   { Function GetCpuType }
  53.  
  54. Function GetCpuTypeStr : CpuStrType;
  55.   { Returns the currently executing CPU type as a string }
  56. Begin
  57.   IdentifyCpuType;
  58.   Case ConfirmedCpuType Of
  59.     cpu8088    : GetCpuTypeStr := '8088';
  60.     cpu8086    : GetCpuTypeStr := '8086';
  61.     cpu80286   : GetCpuTypeStr := '80286';
  62.     cpu80386   : GetCpuTypeStr := '80386';
  63.     cpu80486   : GetCpuTypeStr := '80486';
  64.     cpuPentium : GetCpuTypeStr := 'Pentium';
  65.     cpuFuture  : GetCpuTypeStr := 'Future';
  66.   End;   { Case }
  67. End;   { Function GetCpuTypeStr }
  68.  
  69. End.
  70. { eof CPU.PAS }
  71.  
  72.  
  73. NOTE  :    Cut the following code to a seperate file, and then
  74.            USE XX34 to DECODE the block which contains CPU.OBJ
  75.            needed with this unit.
  76.  
  77. *XX3401-000399-290893--68--85-63424---------CPU.OBJ--1-OF--1
  78. U+s+14BkRKZYMLBh9Y3HHE466++++-lIRL7WPm--QrBZPK7gNL6U63NZQbBdPqsUAmsm
  79. aMUI+21dBaTF4UlXQ5JdN43nPGt-Iop0W+A+ECZAZU6++4W6+k-+cNGK-U+2Eox2FIKM
  80. -k-6wk+0+E2WY+w+++26JoV7EoV1I3I+++1xW+E+E86-YO1r++2++-uAm6vMu-k+D+7x
  81. -SUk+CgFu2Y+D+Bw0iVV+1k2T+DcV++TmtmQKs5XzkxHbNlPUSA+w1D+UTg+w5E0g+8R
  82. kkOAm6v+zPc-+9xM+90EiEA+wufwY70EGd0EWw65ktkD+S1Fq5A3i+A+ul0s+5-EbNlM
  83. UCFki+6+R+3+bQC9y6jQNdlab4NMNUo+++E+NZ-abKOQNZVaeE++-+-o+t0EFqORWyC9
  84. lwBab4NMNcjMNXI++0++NZ-abKOQNZVaIqORNWI++0++Nc5X+++U+4MvkrESY7-ai+2+
  85. +++Dch5coSXFuB5coSXFuB5coSUZ1k11i+E+kumQ-E12GJE-zMc0++-o
  86. ***** END OF XX-BLOCK *****
  87.  
  88.  
  89.